<!DOCTYPE html>
<html lang="en">
  <head>
    <title>SpreadsheetViewDelegate Protocol Reference</title>
    <link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
    <link rel="stylesheet" type="text/css" href="../css/highlight.css" />
    <meta charset='utf-8'>
    <script src="../js/jquery.min.js" defer></script>
    <script src="../js/jazzy.js" defer></script>
    
  </head>
  <body>
    <a name="//apple_ref/swift/Protocol/SpreadsheetViewDelegate" class="dashAnchor"></a>
    <a title="SpreadsheetViewDelegate Protocol Reference"></a>
    <header>
      <div class="content-wrapper">
        <p><a href="../index.html"> Docs</a> (68% documented)</p>
        <p class="header-right"><a href="https://github.com/kishikawakatsumi/SpreadsheetView"><img src="../img/gh.png"/>View on GitHub</a></p>
      </div>
    </header>
    <div class="content-wrapper">
      <p id="breadcrumbs">
        <a href="../index.html"> Reference</a>
        <img id="carat" src="../img/carat.png" />
        SpreadsheetViewDelegate Protocol Reference
      </p>
    </div>
    <div class="content-wrapper">
      <nav class="sidebar">
        <ul class="nav-groups">
          <li class="nav-group-name">
            <a href="../Classes.html">Classes</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a href="../Classes/SpreadsheetView.html">SpreadsheetView</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
            <a href="../Protocols.html">Protocols</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a href="../Protocols/SpreadsheetViewDataSource.html">SpreadsheetViewDataSource</a>
              </li>
              <li class="nav-group-task">
                <a href="../Protocols/SpreadsheetViewDelegate.html">SpreadsheetViewDelegate</a>
              </li>
            </ul>
          </li>
        </ul>
      </nav>
      <article class="main-content">
        <section>
          <section class="section">
            <h1>SpreadsheetViewDelegate</h1>
              <div class="declaration">
                <div class="language">
                  <pre class="highlight"><code><span class="kd">public</span> <span class="kd">protocol</span> <span class="kt">SpreadsheetViewDelegate</span><span class="p">:</span> <span class="kd">class</span></code></pre>

                </div>
              </div>
            <p>The <code>SpreadsheetViewDelegate</code> protocol defines methods that allow you to manage the selection and
highlighting of cells in a spreadsheet view and to perform actions on those cells.
The methods of this protocol are all optional.</p>

          </section>
          <section class="section task-group-section">
            <div class="task-group">
              <ul>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:15SpreadsheetView0aB8DelegateP011spreadsheetB0SbA2AC_10Foundation9IndexPathV21shouldHighlightItemAttF"></a>
                    <a name="//apple_ref/swift/Method/spreadsheetView(_:shouldHighlightItemAt:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:15SpreadsheetView0aB8DelegateP011spreadsheetB0SbA2AC_10Foundation9IndexPathV21shouldHighlightItemAttF">spreadsheetView(_:shouldHighlightItemAt:)</a>
                    </code>
                      <span class="declaration-note">
                        Default implementation
                      </span>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Asks the delegate if the cell should be highlighted during tracking.</p>
<div class="aside aside-note">
    <p class="aside-title">Note</p>
    As touch events arrive, the spreadsheet view highlights cells in anticipation of the user selecting them.
As it processes those touch events, the collection view calls this method to ask your delegate if a given cell should be highlighted.
It calls this method only in response to user interactions and does not call it if you programmatically set the highlighting on a cell.

</div>

<p>If you do not implement this method, the default return value is <code>true</code>.</p>

                      </div>
                      <h4>Default Implementation</h4>
                      <div class="default_impl abstract">
                        
                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight"><code><span class="kd">func</span> <span class="nf">spreadsheetView</span><span class="p">(</span><span class="n">_</span> <span class="nv">spreadsheetView</span><span class="p">:</span> <span class="kt"><a href="../Classes/SpreadsheetView.html">SpreadsheetView</a></span><span class="p">,</span> <span class="n">shouldHighlightItemAt</span> <span class="nv">indexPath</span><span class="p">:</span> <span class="kt">IndexPath</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Bool</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Parameters</h4>
                        <table class="graybox">
                          <tbody>
                            <tr>
                              <td>
                                <code>
                                <em>spreadsheetView</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The spreadsheet view object that is asking about the highlight change.</p>
                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>indexPath</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The index path of the cell to be highlighted.</p>
                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                      <div>
                        <h4>Return Value</h4>
                        <p><code>true</code> if the item should be highlighted or <code>false</code> if it should not.</p>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:15SpreadsheetView0aB8DelegateP011spreadsheetB0yA2AC_10Foundation9IndexPathV18didHighlightItemAttF"></a>
                    <a name="//apple_ref/swift/Method/spreadsheetView(_:didHighlightItemAt:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:15SpreadsheetView0aB8DelegateP011spreadsheetB0yA2AC_10Foundation9IndexPathV18didHighlightItemAttF">spreadsheetView(_:didHighlightItemAt:)</a>
                    </code>
                      <span class="declaration-note">
                        Default implementation
                      </span>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Tells the delegate that the cell at the specified index path was highlighted.</p>
<div class="aside aside-note">
    <p class="aside-title">Note</p>
    <p>The spreadsheet view calls this method only in response to user interactions and does not call it
if you programmatically set the highlighting on a cell.</p>

</div>

                      </div>
                      <h4>Default Implementation</h4>
                      <div class="default_impl abstract">
                        
                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight"><code><span class="kd">func</span> <span class="nf">spreadsheetView</span><span class="p">(</span><span class="n">_</span> <span class="nv">spreadsheetView</span><span class="p">:</span> <span class="kt"><a href="../Classes/SpreadsheetView.html">SpreadsheetView</a></span><span class="p">,</span> <span class="n">didHighlightItemAt</span> <span class="nv">indexPath</span><span class="p">:</span> <span class="kt">IndexPath</span><span class="p">)</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Parameters</h4>
                        <table class="graybox">
                          <tbody>
                            <tr>
                              <td>
                                <code>
                                <em>spreadsheetView</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The spreadsheet view object that is notifying you of the highlight change.</p>
                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>indexPath</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The index path of the cell that was highlighted.</p>
                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:15SpreadsheetView0aB8DelegateP011spreadsheetB0yA2AC_10Foundation9IndexPathV20didUnhighlightItemAttF"></a>
                    <a name="//apple_ref/swift/Method/spreadsheetView(_:didUnhighlightItemAt:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:15SpreadsheetView0aB8DelegateP011spreadsheetB0yA2AC_10Foundation9IndexPathV20didUnhighlightItemAttF">spreadsheetView(_:didUnhighlightItemAt:)</a>
                    </code>
                      <span class="declaration-note">
                        Default implementation
                      </span>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Tells the delegate that the highlight was removed from the cell at the specified index path.</p>
<div class="aside aside-note">
    <p class="aside-title">Note</p>
    <p>The spreadsheet view calls this method only in response to user interactions and does not call it
if you programmatically change the highlighting on a cell.</p>

</div>

                      </div>
                      <h4>Default Implementation</h4>
                      <div class="default_impl abstract">
                        
                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight"><code><span class="kd">func</span> <span class="nf">spreadsheetView</span><span class="p">(</span><span class="n">_</span> <span class="nv">spreadsheetView</span><span class="p">:</span> <span class="kt"><a href="../Classes/SpreadsheetView.html">SpreadsheetView</a></span><span class="p">,</span> <span class="n">didUnhighlightItemAt</span> <span class="nv">indexPath</span><span class="p">:</span> <span class="kt">IndexPath</span><span class="p">)</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Parameters</h4>
                        <table class="graybox">
                          <tbody>
                            <tr>
                              <td>
                                <code>
                                <em>spreadsheetView</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The spreadsheet view object that is notifying you of the highlight change.</p>
                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>indexPath</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The index path of the cell that had its highlight removed.</p>
                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:15SpreadsheetView0aB8DelegateP011spreadsheetB0SbA2AC_10Foundation9IndexPathV18shouldSelectItemAttF"></a>
                    <a name="//apple_ref/swift/Method/spreadsheetView(_:shouldSelectItemAt:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:15SpreadsheetView0aB8DelegateP011spreadsheetB0SbA2AC_10Foundation9IndexPathV18shouldSelectItemAttF">spreadsheetView(_:shouldSelectItemAt:)</a>
                    </code>
                      <span class="declaration-note">
                        Default implementation
                      </span>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Asks the delegate if the specified cell should be selected.</p>
<div class="aside aside-note">
    <p class="aside-title">Note</p>
    The spreadsheet view calls this method when the user tries to select an item in the collection view.
It does not call this method when you programmatically set the selection.

</div>

<p>If you do not implement this method, the default return value is <code>true</code>.</p>

                      </div>
                      <h4>Default Implementation</h4>
                      <div class="default_impl abstract">
                        
                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight"><code><span class="kd">func</span> <span class="nf">spreadsheetView</span><span class="p">(</span><span class="n">_</span> <span class="nv">spreadsheetView</span><span class="p">:</span> <span class="kt"><a href="../Classes/SpreadsheetView.html">SpreadsheetView</a></span><span class="p">,</span> <span class="n">shouldSelectItemAt</span> <span class="nv">indexPath</span><span class="p">:</span> <span class="kt">IndexPath</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Bool</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Parameters</h4>
                        <table class="graybox">
                          <tbody>
                            <tr>
                              <td>
                                <code>
                                <em>spreadsheetView</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The spreadsheet view object that is asking whether the selection should change.</p>
                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>indexPath</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The index path of the cell to be selected.</p>
                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                      <div>
                        <h4>Return Value</h4>
                        <p><code>true</code> if the item should be selected or <code>false</code> if it should not.</p>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:15SpreadsheetView0aB8DelegateP011spreadsheetB0SbA2AC_10Foundation9IndexPathV20shouldDeselectItemAttF"></a>
                    <a name="//apple_ref/swift/Method/spreadsheetView(_:shouldDeselectItemAt:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:15SpreadsheetView0aB8DelegateP011spreadsheetB0SbA2AC_10Foundation9IndexPathV20shouldDeselectItemAttF">spreadsheetView(_:shouldDeselectItemAt:)</a>
                    </code>
                      <span class="declaration-note">
                        Default implementation
                      </span>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Asks the delegate if the specified item should be deselected.</p>
<div class="aside aside-note">
    <p class="aside-title">Note</p>
    The spreadsheet view calls this method when the user tries to deselect a cell in the spreadsheet view.
It does not call this method when you programmatically deselect items.

</div>

<p>If you do not implement this method, the default return value is <code>true</code>.</p>

<p>This method is called when the user taps on an already-selected item in multi-select mode</p>

                      </div>
                      <h4>Default Implementation</h4>
                      <div class="default_impl abstract">
                        
                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight"><code><span class="kd">func</span> <span class="nf">spreadsheetView</span><span class="p">(</span><span class="n">_</span> <span class="nv">spreadsheetView</span><span class="p">:</span> <span class="kt"><a href="../Classes/SpreadsheetView.html">SpreadsheetView</a></span><span class="p">,</span> <span class="n">shouldDeselectItemAt</span> <span class="nv">indexPath</span><span class="p">:</span> <span class="kt">IndexPath</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Bool</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Parameters</h4>
                        <table class="graybox">
                          <tbody>
                            <tr>
                              <td>
                                <code>
                                <em>spreadsheetView</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The spreadsheet view object that is asking whether the selection should change.</p>
                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>indexPath</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The index path of the cell to be deselected.</p>
                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                      <div>
                        <h4>Return Value</h4>
                        <p><code>true</code> if the cell should be deselected or <code>false</code> if it should not.</p>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:15SpreadsheetView0aB8DelegateP011spreadsheetB0yA2AC_10Foundation9IndexPathV15didSelectItemAttF"></a>
                    <a name="//apple_ref/swift/Method/spreadsheetView(_:didSelectItemAt:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:15SpreadsheetView0aB8DelegateP011spreadsheetB0yA2AC_10Foundation9IndexPathV15didSelectItemAttF">spreadsheetView(_:didSelectItemAt:)</a>
                    </code>
                      <span class="declaration-note">
                        Default implementation
                      </span>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Tells the delegate that the cell at the specified index path was selected.</p>
<div class="aside aside-note">
    <p class="aside-title">Note</p>
    <p>The spreadsheet view calls this method when the user successfully selects a cell in the spreadsheet view.
It does not call this method when you programmatically set the selection.</p>

</div>

                      </div>
                      <h4>Default Implementation</h4>
                      <div class="default_impl abstract">
                        
                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight"><code><span class="kd">func</span> <span class="nf">spreadsheetView</span><span class="p">(</span><span class="n">_</span> <span class="nv">spreadsheetView</span><span class="p">:</span> <span class="kt"><a href="../Classes/SpreadsheetView.html">SpreadsheetView</a></span><span class="p">,</span> <span class="n">didSelectItemAt</span> <span class="nv">indexPath</span><span class="p">:</span> <span class="kt">IndexPath</span><span class="p">)</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Parameters</h4>
                        <table class="graybox">
                          <tbody>
                            <tr>
                              <td>
                                <code>
                                <em>spreadsheetView</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The spreadsheet view object that is notifying you of the selection change.</p>
                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>indexPath</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The index path of the cell that was selected.</p>
                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:15SpreadsheetView0aB8DelegateP011spreadsheetB0yA2AC_10Foundation9IndexPathV17didDeselectItemAttF"></a>
                    <a name="//apple_ref/swift/Method/spreadsheetView(_:didDeselectItemAt:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:15SpreadsheetView0aB8DelegateP011spreadsheetB0yA2AC_10Foundation9IndexPathV17didDeselectItemAttF">spreadsheetView(_:didDeselectItemAt:)</a>
                    </code>
                      <span class="declaration-note">
                        Default implementation
                      </span>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Tells the delegate that the cell at the specified path was deselected.</p>
<div class="aside aside-note">
    <p class="aside-title">Note</p>
    <p>The spreadsheet view calls this method when the user successfully deselects an item in the spreadsheet view.
It does not call this method when you programmatically deselect items.</p>

</div>

                      </div>
                      <h4>Default Implementation</h4>
                      <div class="default_impl abstract">
                        
                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight"><code><span class="kd">func</span> <span class="nf">spreadsheetView</span><span class="p">(</span><span class="n">_</span> <span class="nv">spreadsheetView</span><span class="p">:</span> <span class="kt"><a href="../Classes/SpreadsheetView.html">SpreadsheetView</a></span><span class="p">,</span> <span class="n">didDeselectItemAt</span> <span class="nv">indexPath</span><span class="p">:</span> <span class="kt">IndexPath</span><span class="p">)</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Parameters</h4>
                        <table class="graybox">
                          <tbody>
                            <tr>
                              <td>
                                <code>
                                <em>spreadsheetView</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The spreadsheet view object that is notifying you of the selection change.</p>
                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>indexPath</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The index path of the cell that was deselected.</p>
                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
          </section>
        </section>
        <section id="footer">
          <p>&copy; 2017 <a class="link" href="https://kishikawakatsumi.com/" target="_blank" rel="external">kishikawakatsumi</a>. All rights reserved. (Last updated: 2017-10-14)</p>
          <p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
        </section>
      </article>
    </div>
  </body>
</div>
</html>
